package com.woquyin.vo;

import java.io.Serializable;

import com.woquyin.common.Constance;

/**
 *
 * @author heem
 * @create time 2017年8月13日上午10:10:24
 * @param <T>
 */
public class ReturnData<T> implements Serializable{
	
	private static final long serialVersionUID = 1L;
	private int code;
	private String msg;
	private T data;

	public int getCode() {
		return code;
	}

	public ReturnData<T> setCode(int code) {
		this.code = code;
		return this;
	}

	public String getMsg() {
		return msg;
	}

	public ReturnData<T> setMsg(String msg) {
		this.msg = msg;
		return this;
	}

	public T getData() {
		return data;
	}

	public ReturnData<T> setData(T data) {
		this.data = data;
		return this;
	}

	public ReturnData() {
		this.code = Constance.WholeStateCodeEnum.SUCCESS.getCode();
		this.msg = Constance.WholeStateCodeEnum.SUCCESS.getValue();
	}
	
	public ReturnData(int code){
		this.setCode(code);
	}
	
	public ReturnData(int code, String msg){
		this.setCode(code);
		this.setMsg(msg);
	}

	public ReturnData(T data, int code, String msg) {
		this.setData(data);
		this.setCode(code);
		this.setMsg(msg);
	}
}
